package com.xiaoyu.cloud.filter;

import com.xiaoyu.common.core.currentUser.TransmittableThreadLocalRequestHeaders;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import javax.servlet.*;

@Slf4j
public class TransmittableThreadLocalRequestHeadersRemoveFilter implements Filter {
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        chain.doFilter(request, response);
        return;
    }

    @Override
    public void destroy() {
        log.debug("在过滤器清除上下文");
        TransmittableThreadLocalRequestHeaders.remove();
    }
}
